import { defineStore } from 'pinia';

import { api, Node } from '@/api';


export const useGraphStore = defineStore('graph', {
	state: () => {
		return {
			nodes: [] as Node[]
		};
	},
	actions: {
		init() {
			api.getGraph().then(response => {
				this.nodes = response.graph.nodes || [];
			});
		}
	}
});